Release 10.1A: OpenEdge Development:
Programming Interfaces
Using the HEADER of a frame for running page heads
A frame can contain three distinct sections: body,
HEADER, andBACKGROUND. Until now, everything you placed in a frame became part of the frame body. Using the keywordsHEADERandBACKGROUND, you can also define two additional sections for your frames. The code fragment below shows how aDEFINE FRAMEstatement with these sections would look:
Frame backgrounds are typically used for placing a logo (image) or other graphic device in the background of a display frame. However, you cannot print graphics from the Progress 4GL. For more information, see the OpenEdge Development: Progress 4GL Reference . The rest of this section concentrates on the
HEADERpart of the frame.The
HEADERhas a couple of special properties that allow you to implement running page heads and footers:If a
HEADERframe contains an expression, field, or variable, the frame definition must take place in the context where Progress can provide new values. In other words, for an iterating report procedure, move theDEFINE FRAMEstatement from the top of your procedure into theFOR EACHblock. Think of aHEADERframe as an executable statement. Just like aDISPLAYstatement inside aFOR EACHblock, theHEADERsection of theDEFINE FRAMEstatement executes on every iteration of theFOREACHblock.Also, note that a frame does not have to have a body—it can consist of a header only. You can modularize your report design with three frames: one each for page header, body, and page footer. This approach lets you adopt standard headers and footers.
Assume that All Around Sports wants a standard page header on every page of its reports. This is the information they want to include in the page header:
This code defines the first part of a procedure that implements the three-frame design:
This part of the procedure contains the following language elements and points of interest:
- The
PAGE-SIZEoption of theOUTPUTstatement sets the default size for a report page.- The
HEADERoption tells Progress to place the specified items in the header section at the top of the frame.- The
TODAYfunction returns the current system date, and constitutes an expression.- The Sales-rep initials come from the database and represent another part of the
HEADERthat Progress must evaluate.- The
PAGE-NUMBERfunction tracks the current page number (expression).- The
PAGE-TOP FRAMEf-hdr further defines what kind ofHEADERthe frame is.PAGE-TOPspecifies where to place the frame and makes the frame a running page head.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |